#include <my_head.h>

int main(int argc, const char *argv[]){
    int fd[2];
    if(-1 == pipe(fd))
        ERR_LOG("pipe error");
    write(fd[1],"hello",5);//向管道中写入数据
    char buff[10] = {0};
    read(fd[0],buff,sizeof(buff));//读取管道中的数据
    printf("读到的内容 [%s]\n",buff);
    close(fd[0]);
    close(fd[1]);
    return 0;
}